home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / libg_261.zip / libg_261 / libg++ / configure.in < prev    next >
Text File  |  1994-10-24  |  5KB  |  141 lines

  1. # This file is a shell script fragment that supplies the information
  2. # necessary to tailor a template configure script into the configure
  3. # script appropriate for this directory.  For more information, check
  4. # any existing configure script.
  5.  
  6. configdirs="genclass no-stream old-stream src tests gperf utils etc test-install"
  7. srctrigger=libg++.texi
  8. srcname="GNU C++ Class Library"
  9.  
  10. # per-host:
  11.  
  12. # per-target:
  13.  
  14. package_makefile_frag=Make.pack
  15.  
  16.     echo "# Warning this fragment is automatically generated" >temp.mt
  17.     rootme=`pwd`
  18.     export rootme
  19. #    CC=${CC-`if [ -f ${rootme}/../gcc/xgcc ] ; \
  20. #            then echo ${rootme}/../gcc/xgcc -B${rootme}/../gcc/ ; \
  21. #            else echo gcc ; fi`}
  22.     CONFIG_NM=${CONFIG_NM-nm}
  23.  
  24.     # The Bourne shell writes "command not found" to /dev/tty, so if we get
  25.     # a usage message on stderr, we have the program.
  26.     #
  27.     # ksh and zsh write "command not found" to stderr, but test -n does not
  28.     # want any output if there is no program.  So we use the `type' builtin
  29.     # instead for them (and bash).
  30.     if test "$RANDOM" = "$RANDOM"; then
  31.       checkfor='test -n "`$checkprog $checkargs 2>&1`"'
  32.     else
  33.       checkfor='type $checkprog >/dev/null'
  34.     fi
  35.  
  36.     echo checking for ranlib
  37.     checkprog=ranlib checkargs=/dev/null
  38.     if [ -n "$RANLIB" ] ; then
  39.         echo "RANLIB = ${RANLIB}" >>temp.mt
  40.     elif (eval $checkfor) >/dev/null 2>&1 ; then
  41.         # Use default value set in Makefile
  42.         echo "# RANLIB = ranlib" >>temp.mt
  43.     else
  44.         echo "RANLIB = true" >>temp.mt
  45.     fi
  46.  
  47.     # Check if we have reasonable include files:
  48. #cat >temp.c <<'EOF'
  49. ##include <unistd.h>
  50. ##include <stdarg.h>
  51. ##include <stdio.h>
  52. ##include <string.h>
  53. ##include <stdlib.h>
  54. #int call() { return 0; }
  55. #int main()
  56. #{
  57. #  call(fclose);
  58. #  call(rename);
  59. #  return call(memcmp);
  60. #}
  61. #EOF
  62. #    if [ -s "`${CC} -o temp temp.c 2>&1`" ] ; then true
  63. #    else
  64. #        # Include files look tolerable
  65. #        echo 'WRAP_C_INCLUDES =' >>temp.mt
  66. #    fi
  67.  
  68.     # Some recent systems wrap extern "C" around function declarations
  69.     # in the system C header files.  Unfortunately, some systems
  70.     # (such as Irix) miss the extern "C" in curses.h, say,
  71.     # though they have it in *most* of the header files,
  72.     # so it is hard to test for this automatically.
  73. #    echo "(checking if C include files have 'extern" '"C"'"')"
  74. #    echo '#include <unistd.h>' >temp.c
  75. #    if ${CC} -E -D__cplusplus temp.c | grep 'extern "C"' 2>&1 >/dev/null ; then
  76. #        echo 'WRAP_C_INCLUDES =' >>temp.mt
  77. #    else
  78.  
  79.             echo '
  80. # If the C include files are C++-ready (with extern "C"), uncomment next line:
  81. # WRAP_C_INCLUDES =' >>temp.mt
  82.  
  83. echo '
  84. # Flags to pass to gen-params when building _G_config.h.
  85. # For example: G_CONFIG_ARGS = size_t="unsigned long"
  86. G_CONFIG_ARGS =' >>temp.mt
  87.  
  88. rm -f temp.c temp.o temp
  89.  
  90. case "${target}" in
  91.   i[345]86-*-linux) my_target=linux ;;
  92.   *-*-solaris2*)   my_target=solaris2 ;;
  93.   *-*-solaris)     my_target=solaris2 ;;
  94.   *-*-*)           my_target=${target_cpu}
  95. esac
  96.  
  97. target_makefile_frag=config/${my_target}.mt
  98. if [ -f ${srcdir}/${target_makefile_frag} ] ; then
  99.   echo "Appending ${srcdir}/${target_makefile_frag} to target-mkfrag"
  100.   echo "# Following fragment copied from ${srcdir}/${target_makefile_frag}" >>temp.mt
  101.   cat ${srcdir}/${target_makefile_frag} >>temp.mt
  102. fi
  103.  
  104. ${moveifchange} temp.mt target-mkfrag
  105.  
  106. TOLIBGXX=
  107. ALL='$(TARGETLIB) rest-in-parallel'
  108. MOSTLYCLEAN='*.o core \#* temp.c stamp-$(TARGETLIB) dummy.out dummy.[Cc] TMP a.out'
  109. CLEAN='.stmp-* _G_config.h $(TARGETLIB)'
  110. DISTCLEAN='config.status Makefile target-mkfrag'
  111. INFO_FILES=libg++
  112. INFO_SUBDIRS='$(SUBDIRS)'
  113.  
  114. # If cross-compiling, don't configure gperf or test-install, since
  115. # they do not work (gperf and utils will get built by the target
  116. # compiler, which is confusing, and test-install will try to execute
  117. # programs built by the target compiler, which can not be done).
  118. if [ ${host} != ${target} ] ; then
  119.   configdirs=`echo ${configdirs} | sed -e 's/gperf//' -e 's/test-install//' -e 's/utils//'`
  120. fi
  121.  
  122. (. ${srcdir}/config.shared) >${package_makefile_frag}
  123.  
  124. # post-target:
  125.  
  126. # If cross-compiling, don't build gperf or the utils.  They
  127. # will get built by the target compiler, which is confusing.
  128. # We cannot test the installation.  We install in $(tooldir).
  129. if [ ${host} != ${target} ] ; then
  130.     sed \
  131.     -e 's|INSTALLDIR.*=.*$|INSTALLDIR = $(tooldir)/lib|' \
  132.     -e 's|GPERF.*=.*gperf|GPERF = # gperf|' \
  133.     -e 's|TEST_INSTALL[     ]*=.*$|TEST_INSTALL = |' \
  134.     -e 's|UTILS[     ]*=.*$|UTILS =|' \
  135.     -e 's|LIBIBERTY =.*$|LIBIBERTY = xiberty|' \
  136.     Makefile >Makefile.tem
  137.     mv -f Makefile.tem Makefile
  138. fi
  139.  
  140. rm -f ${package_makefile_frag}
  141.